﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BlueCMS.Core.Entities
{
    public class NodePermissionRoleLink
    {
        public Guid node_id { get; set; }
        public Guid permission_id { get; set; }
        public Guid role_id { get; set; }
        public Guid website_id { get; set; }

        public NodePermissionRoleLink() { }

        public NodePermissionRoleLink(Node node, Permission permission, Role role)
        {
            if (node.website_id != role.website_id)
            {
                throw new ArgumentException("Node and Role not from same website.");
            }

            node_id = node.node_id;
            permission_id = permission.permission_id;
            role_id = role.role_id;
            website_id = node.node_id;
        }
    }
}
